package org.skavookie.spaces

/**
 * Created by IntelliJ IDEA.
 * User: joshua
 * Date: 10/2/11
 * Time: 3:38 PM
 * To change this template use File | Settings | File Templates.
 */

trait Norm[X,R] {
  /**
   * ||x|| >= 0
   * ||ax|| = |a|||x||
   * ||x+y|| <= ||x|| + ||y||
   * ||x|| = 0 implies x = 0
   * norm(x) = ||x||
   */
  def norm(x: X): R
}

trait NormMetric[X,R] extends Norm[X,R] with LinearSpace[X,R] with Metric[X,R] {
  def d(x: X, y: X): R = norm(plus(x, neg(y)))
}
